package com.example.service;

import cn.hutool.core.date.DateUtil;
import com.example.dao.NoticeDao;
import com.example.entity.Notice;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.unit.DataUnit;

import java.util.List;
import java.util.Timer;
import java.util.concurrent.TimeUnit;

@Service
public class NoticeService {

    @Resource
    private NoticeDao noticeDao;

    public List<Notice> findNotice(Notice notice) {
        List<Notice> noticeList = noticeDao.findNotice(notice);
        return noticeList;
    }

    //新增系统公告信息
    public void addNotice(Notice notice) {
        Notice noticeinfo = new Notice(null, notice.getNoticename(), notice.getNotice(), DateUtil.now());
        noticeDao.addNotice(noticeinfo);
    }
}
